import Http from './http'
import '@tarojs/async-await'

const http = new Http()
const host = 'https://julun.guoxiaoge.cn';

//小程序登录
export const login = (data: object) => http.post(host + '/pluto/wechat/login/mini', data);

//小程序授权
export const authorize = (data: object) => http.post(host + '/pluto/wechat/authorize/mini', data);

//获取当前登录用户信息
export const userInfo = () => http.get(host + '/pluto/user/current', {});

//首页轮播图
export const banners = () => http.get(host + '/pluto/banner', {});

//首页商品列表
export const indexGoods= () => http.get(host + '/pluto/goods/list', {});

//商品详情
export const goodsDetail= (id) => http.get(host + '/pluto/goods/info/' + id.id, {});

//添加或者修改购物车
export const cart = (data: object) => http.post(host + '/pluto/order/cart', data);

//购物车列表
export const cartList = (data: object) => http.get(host + '/pluto/order/cart/list', data);

//结算订单
export const initOrder = (data: object) => http.post(host + '/pluto/order/init', data);

//结算订单详情
export const confirm = (data: object) => http.get(host + '/pluto/order', data);

//获取收货地址
export const address = (data: object) => http.get(host + '/pluto/user/address', data);